import { PageContainer } from '@ant-design/pro-layout';
import type { FormInstance } from 'antd';
import { Button, Divider } from 'antd';
import { useReducer, useRef, useState } from 'react';
import Detail from './mainContent/detail';
import { PlusOutlined } from '@ant-design/icons';
import type { ProColumns } from '@ant-design/pro-components';
import { ModalForm, ProFormDateTimePicker, ProFormText } from '@ant-design/pro-components';
import { ProTable } from '@ant-design/pro-components';
import styles from './index.less';
import type { RangePickerProps } from 'antd/lib/date-picker';
import DatePicker from 'antd/lib/date-picker';
import moment from 'moment';
import type { orderList } from './types';
import { overPark } from './service';

export default () => {
  const columns: ProColumns<orderList>[] = [
    {
      title: '退款单号',
      dataIndex: 'orderNo',
      hideInForm: true,
      hideInSearch: false,
    },
    {
      title: '车牌号码',
      dataIndex: 'zoneName',
      hideInForm: true,
      hideInSearch: false,
    },
    {
      title: '订单编号',
      dataIndex: 'carType',
      hideInSearch: false,
    },
    {
      title: '支付记录编号',
      dataIndex: 'plateColor',
      hideInSearch: false,
    },
    {
      title: '退款金额',
      dataIndex: 'type',
      hideInSearch: true,
      render: (_, record) => {
        if (record) return <div>{Number(record.totalActualAmount).toFixed(2)}</div>;
      },
    },
    {
      title: '退款状态',
      dataIndex: 'orderStatus',
      hideInSearch: false,
    },
    {
      title: '申请时间',
      dataIndex: 'stoppable',
      hideInSearch: true,
    },
    {
      title: '退款时间',
      dataIndex: 'totalAmount',
      hideInSearch: true,
      render: (_, record) => {
        if (record) return <div>{Number(record.totalAmount).toFixed(2)}</div>;
      },
    },
    {
      title: '处理人员',
      dataIndex: 'totalActualAmount',
      hideInSearch: false,
    },
  ];
  return (
    <PageContainer>
      {
        <ProTable<any>
          rowKey="parkinglotId"
          columns={columns}
          scroll={{ x: true }}
          style={{ whiteSpace: 'nowrap' }}
          columnEmptyText="暂无数据"
          headerTitle="退款记录列表"
          pagination={{
            size: 'default',
            showQuickJumper: true,
            showSizeChanger: true,
            defaultPageSize: 10,
          }}
          // request={(param) => getOrderTable(param)}
        />
      }
    </PageContainer>
  );
};
